from tensorflow import keras
from tensorflow.keras import layers
from tensorflow.keras import optimizers
import numpy as np
from sip import voidptr
from sim.nnutil import loadModel
from npend import NpendReader as NR

def loadData():
    dataPath = '../data/dataTest.npd'
    labelPath = '../data/labelTest.npd'
    data=NR(dataPath).read()
    label=NR(labelPath).read()
    return data,label

if __name__=="__main__":
    data,label=loadData()
    label=keras.utils.to_categorical(label,num_classes=5)
    model = loadModel('./modelCNN.tf')
    score = model.evaluate(data, label, verbose=0)
    print("Test loss:", score[0])
    print("Test accuracy:", score[1])